package edu.guet.server.mapper;

import edu.guet.server.model.TecherCourse;
import edu.guet.server.model.dto.TeamTeacherDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TechSemMapper {
    /**
     * 教师创建新课程
     * @param techSemester
     */
//    @Insert("insert into tech_semester(course_id, course_id) values (#{course_id},#{course_id})")
    void addTechCourse(TecherCourse techSemester);

    /**
     * 添加教学团队成员
     * @param teamTeacherDTO
     */
    @Select("INSERT INTO tech_course(user_id, course_id) values (#{user_id},#{course_id})")
    void addTeamTeacher(TeamTeacherDTO teamTeacherDTO);

    /**
     * 根据老师id查课程ids
     * @param techId
     * @return
     */
    @Select("select semester_id from semester where tech_id=#{tech_id}")
    List<Integer> findsemesterIdsBytechId(Integer techId);

    /**
     * 根据课程id查老师ids
     * @param semId
     * @return
     */
    @Select("select user_id from tech_course where course_id=#{course_id}")
    List<Integer> findtechIdsBysemId(Integer semId);

    TecherCourse findcourseIdsBytechId(TeamTeacherDTO userId);
}
